home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue42 / ASP / delphi_TLB.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-11-19  |  6.7 KB  |  159 lines

  1. unit delphi_TLB;
  2.  
  3. // ************************************************************************ //
  4. // WARNING                                                                  //
  5. // -------                                                                  //
  6. // The types declared in this file were generated from data read from a     //
  7. // Type Library. If this type library is explicitly or indirectly (via      //
  8. // another type library referring to this type library) re-imported, or the //
  9. // 'Refresh' command of the Type Library Editor activated while editing the //
  10. // Type Library, the contents of this file will be regenerated and all      //
  11. // manual modifications will be lost.                                       //
  12. // ************************************************************************ //
  13.  
  14. // PASTLWTR : $Revision:   1.11.1.63  $
  15. // File generated on 19/11/98 18:27:05 from Type Library described below.
  16.  
  17. // ************************************************************************ //
  18. // Type Lib: E:\Developer\Delphi\COM\ASP\15Seconds\delphi.tlb
  19. // IID\LCID: {90A90DC0-38A2-11D0-A4D6-C95D0F807C0B}\0
  20. // Helpfile: 
  21. // HelpString: Project1 Library
  22. // Version:    1.0
  23. // ************************************************************************ //
  24.  
  25. interface
  26.  
  27. uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL;
  28.  
  29. // *********************************************************************//
  30. // GUIDS declared in the TypeLibrary. Following prefixes are used:      //
  31. //   Type Libraries     : LIBID_xxxx                                    //
  32. //   CoClasses          : CLASS_xxxx                                    //
  33. //   DISPInterfaces     : DIID_xxxx                                     //
  34. //   Non-DISP interfaces: IID_xxxx                                      //
  35. // *********************************************************************//
  36. const
  37.   LIBID_delphi: TGUID = '{90A90DC0-38A2-11D0-A4D6-C95D0F807C0B}';
  38.   IID_ISimpleObject: TGUID = '{90A90DC1-38A2-11D0-A4D6-C95D0F807C0B}';
  39.   CLASS_SimpleObject: TGUID = '{90A90DC3-38A2-11D0-A4D6-C95D0F807C0B}';
  40.   IID_ISQLObj: TGUID = '{F4A0F764-78B1-11D2-A4D6-8AC98C355D52}';
  41.   CLASS_SQLObj: TGUID = '{F4A0F766-78B1-11D2-A4D6-8AC98C355D52}';
  42. type
  43.  
  44. // *********************************************************************//
  45. // Forward declaration of interfaces defined in Type Library            //
  46. // *********************************************************************//
  47.   ISimpleObject = interface;
  48.   ISimpleObjectDisp = dispinterface;
  49.   ISQLObj = interface;
  50.   ISQLObjDisp = dispinterface;
  51.  
  52. // *********************************************************************//
  53. // Declaration of CoClasses defined in Type Library                     //
  54. // (NOTE: Here we map each CoClass to its Default Interface)            //
  55. // *********************************************************************//
  56.   SimpleObject = ISimpleObject;
  57.   SQLObj = ISQLObj;
  58.  
  59.  
  60. // *********************************************************************//
  61. // Interface: ISimpleObject
  62. // Flags:     (4416) Dual OleAutomation Dispatchable
  63. // GUID:      {90A90DC1-38A2-11D0-A4D6-C95D0F807C0B}
  64. // *********************************************************************//
  65.   ISimpleObject = interface(IDispatch)
  66.     ['{90A90DC1-38A2-11D0-A4D6-C95D0F807C0B}']
  67.     function Get_FirstName: WideString; safecall;
  68.     procedure Set_FirstName(const Value: WideString); safecall;
  69.     function Get_LastName: WideString; safecall;
  70.     procedure Set_LastName(const Value: WideString); safecall;
  71.     procedure WriteData; safecall;
  72.     procedure OnStartPage(const unk: IUnknown); safecall;
  73.     procedure OnEndPage; safecall;
  74.     property FirstName: WideString read Get_FirstName write Set_FirstName;
  75.     property LastName: WideString read Get_LastName write Set_LastName;
  76.   end;
  77.  
  78. // *********************************************************************//
  79. // DispIntf:  ISimpleObjectDisp
  80. // Flags:     (4416) Dual OleAutomation Dispatchable
  81. // GUID:      {90A90DC1-38A2-11D0-A4D6-C95D0F807C0B}
  82. // *********************************************************************//
  83.   ISimpleObjectDisp = dispinterface
  84.     ['{90A90DC1-38A2-11D0-A4D6-C95D0F807C0B}']
  85.     property FirstName: WideString dispid 1;
  86.     property LastName: WideString dispid 3;
  87.     procedure WriteData; dispid 6;
  88.     procedure OnStartPage(const unk: IUnknown); dispid 7;
  89.     procedure OnEndPage; dispid 8;
  90.   end;
  91.  
  92. // *********************************************************************//
  93. // Interface: ISQLObj
  94. // Flags:     (4416) Dual OleAutomation Dispatchable
  95. // GUID:      {F4A0F764-78B1-11D2-A4D6-8AC98C355D52}
  96. // *********************************************************************//
  97.   ISQLObj = interface(IDispatch)
  98.     ['{F4A0F764-78B1-11D2-A4D6-8AC98C355D52}']
  99.     procedure ExecuteSql; safecall;
  100.     procedure OnStartPage(const unk: IUnknown); safecall;
  101.     procedure OnEndPage; safecall;
  102.     function Get_SQL: WideString; safecall;
  103.     procedure Set_SQL(const Value: WideString); safecall;
  104.     function Get_UseProducer: Integer; safecall;
  105.     procedure Set_UseProducer(Value: Integer); safecall;
  106.     property SQL: WideString read Get_SQL write Set_SQL;
  107.     property UseProducer: Integer read Get_UseProducer write Set_UseProducer;
  108.   end;
  109.  
  110. // *********************************************************************//
  111. // DispIntf:  ISQLObjDisp
  112. // Flags:     (4416) Dual OleAutomation Dispatchable
  113. // GUID:      {F4A0F764-78B1-11D2-A4D6-8AC98C355D52}
  114. // *********************************************************************//
  115.   ISQLObjDisp = dispinterface
  116.     ['{F4A0F764-78B1-11D2-A4D6-8AC98C355D52}']
  117.     procedure ExecuteSql; dispid 1;
  118.     procedure OnStartPage(const unk: IUnknown); dispid 7;
  119.     procedure OnEndPage; dispid 8;
  120.     property SQL: WideString dispid 2;
  121.     property UseProducer: Integer dispid 3;
  122.   end;
  123.  
  124.   CoSimpleObject = class
  125.     class function Create: ISimpleObject;
  126.     class function CreateRemote(const MachineName: string): ISimpleObject;
  127.   end;
  128.  
  129.   CoSQLObj = class
  130.     class function Create: ISQLObj;
  131.     class function CreateRemote(const MachineName: string): ISQLObj;
  132.   end;
  133.  
  134. implementation
  135.  
  136. uses ComObj;
  137.  
  138. class function CoSimpleObject.Create: ISimpleObject;
  139. begin
  140.   Result := CreateComObject(CLASS_SimpleObject) as ISimpleObject;
  141. end;
  142.  
  143. class function CoSimpleObject.CreateRemote(const MachineName: string): ISimpleObject;
  144. begin
  145.   Result := CreateRemoteComObject(MachineName, CLASS_SimpleObject) as ISimpleObject;
  146. end;
  147.  
  148. class function CoSQLObj.Create: ISQLObj;
  149. begin
  150.   Result := CreateComObject(CLASS_SQLObj) as ISQLObj;
  151. end;
  152.  
  153. class function CoSQLObj.CreateRemote(const MachineName: string): ISQLObj;
  154. begin
  155.   Result := CreateRemoteComObject(MachineName, CLASS_SQLObj) as ISQLObj;
  156. end;
  157.  
  158. end.
  159.